<?php


namespace App\Http\observer;


use App\Models\BindGood;
use App\Models\Image;

class BindGoodsObserver
{
    public function deleted(BindGood $good)
    {
        $image=Image::where("url",$good["image"])->first();
        if ($image){
            Image::find($image["id"])->delete();
        }
    }
}
